Add end-of-file-fixer to pre-commit#106065
Merged
hugovk merged 4 commits intopython:mainfrom Jun 25, 2023
Merged
Conversation
…hitespace(python_files)
Member
Author
|
Temporary commit not needed, as there's a file that needs fixing: https://github.com/python/cpython/actions/runs/5366030779/jobs/9735224499?pr=106065 |
Member
Author
|
Like diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index e21feee3ed..78627f9839 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -4,7 +4,7 @@ repos:
hooks:
- id: check-yaml
- id: end-of-file-fixer
- types_or: [python]
+ types_or: [c, python, rst]
- id: trailing-whitespace
types_or: [c, python, rst]If so, it would do an initial tidy-up of these files: FilesIf not, we could simplify a bit: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index e21feee3ed..1197ef745e 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -4,7 +4,7 @@ repos:
hooks:
- id: check-yaml
- id: end-of-file-fixer
- types_or: [python]
+ types: [python]
- id: trailing-whitespace
types_or: [c, python, rst] |
AlexWaygood
reviewed
Jun 25, 2023
Member
Let's do the hopefully-uncontroversial bit (adding it for |
Contributor
|
Thanks @hugovk for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
|
GH-106080 is a backport of this pull request to the 3.12 branch. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Jun 25, 2023
(cherry picked from commit 8c24a83) Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
AlexWaygood
pushed a commit
that referenced
this pull request
Jun 25, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow on from #104275.
This adds a check that is part of
make patchcheck'snormalize_whitespace(python_files)to pre-commit, which showed up in PR #105984:https://dev.azure.com/Python/cpython/_build/results?buildId=130810&view=logs&j=256d7e09-002a-52d7-8661-29ee3960640e&t=3d7276d3-4e8d-5309-55ad-fb0b172d9925
Adding here will make the failure more visible, and show the actual change needed.
I'll push another temporary commit to demonstrate.